package com.hxjy.system.init;

import javax.faces.application.Application;
import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.context.ApplicationContext;

import com.hxjy.aid.LoadLicence;
import com.hxjy.constant.Constant;
import com.hxjy.page.Pager;

public class SystemInit implements ServletContextListener{
	private static Log log = LogFactory.getLog(SystemInit.class);
	@Override
	public void contextDestroyed(ServletContextEvent sce) {
		
	}

	@Override
	public void contextInitialized(ServletContextEvent servletContextEvent) {
		//LoadLicence.readComputerMessage(servletContextEvent);
		ServletContext app =  servletContextEvent.getServletContext();
		Pager pager = new Pager();
		pager.setPageSize(Constant.MAX_PAGE_SIZE);
		pager.setPageNum(Constant.MAX_PAGE_NUM);
		app.setAttribute("pager", pager);
		
	}
}
